package com.hippoDocker.feignhystrixorder.service;

import com.hippoDocker.feignhystrixorder.service.fallbackImpl.PaymentFallbackService;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

@Component
//@FeignClient(value = "CLOUD-PROVIDER-HYSTRIX-PAYMENT")
//优先级问题：单独的controller方法上的设置>默认的全局设置>配置类
@FeignClient(name = "cloud-provider-hystrix-payment",fallback = PaymentFallbackService.class)//表明该接口的服务降级处理类
public interface PaymentFeignService {

    @GetMapping("/payment/hystrix/ok/{id}")
    String paymentInfo_OK(@PathVariable("id") Integer id);

    @GetMapping("/payment/hystrix/timeout/{id}")
    String paymentInfo_Timeout(@PathVariable("id") Integer id);
}
